<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>公告信息管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/system/announcement/">公告信息列表</a></li>
		<shiro:hasPermission name="sys:announcement:edit"><li><a href="${ctx}/sys/system/announcement/form">公告信息添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="announcement" action="${ctx}/sys/system/announcement/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
	</form:form>
	<div style="display:none;">
		<sys:message content="${message}"/>
	</div>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>序号</th>
				<th>公告标题</th>
				<th>公告分类</th>
				<th>状态</th>
				<th>最近修改时间</th>
				<shiro:hasPermission name="sys:announcement:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="announcement" varStatus="stats">
			<tr>
				<td>${stats.index+1}</td>
				<td><a href="${ctx}/sys/system/announcement/form?id=${announcement.id}">
					${announcement.title}
				</a></td>
				<td>
					${announcement.type}
				</td>
				<td>
					${fns:getDictLabel(announcement.status, 'public_status', '未发布')}
				</td>
				<td>
					<fmt:formatDate value="${announcement.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<shiro:hasPermission name="sys:announcement:edit">
					<td>
						<c:choose>
							<c:when test="${announcement.status==1}">
	        					<a href="${ctx}/sys/system/announcement/updateStatus?id=${announcement.id}">取消发布</a>
	    					</c:when>
							<c:otherwise>
	       						<a href="${ctx}/sys/system/announcement/updateStatus?id=${announcement.id}">发布</a>
	   					 	</c:otherwise>
						</c:choose>
	    				<a href="${ctx}/sys/system/announcement/form?id=${announcement.id}">修改</a>
						<a href="${ctx}/sys/system/announcement/delete?id=${announcement.id}" onclick="return confirmx('确认要删除该公告信息吗？', this.href)">删除</a>
					</td>
				</shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>